/**
 *Copyright (c) 2024 watereyes
 * safetymanagement is licensed under Mulan PubL v2.
 * You can use this software according to the terms and conditions of the Mulan
 * PubL v2.
 * You may obtain a copy of Mulan PubL v2 at:
 *          http://license.coscl.org.cn/MulanPubL-2.0
 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
 * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
 * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
 * See the Mulan PubL v2 for more details.
 */
package com.koron.emergency.mapper;

import com.koron.emergency.domain.ContingencyPlan;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface ContingencyPlanMapper {
    Integer insert(@Param("bean") ContingencyPlan bean);

    Integer delete(@Param("id") String id);

    Integer update(@Param("bean") ContingencyPlan bean);

    ContingencyPlan queryOne(@Param("id") String id);

    List<ContingencyPlan> queryByCondition(@Param("corpCode") String corpCode,
                                           @Param("contingencyPlanName") String contingencyPlanName,
                                           @Param("contingencyPlanType") String contingencyPlanType,
                                           @Param("start") Integer start,
                                           @Param("rows") Integer rows);

    Integer countByCondition(@Param("corpCode") String corpCode,
                             @Param("contingencyPlanName") String contingencyPlanName,
                             @Param("contingencyPlanType") String contingencyPlanType);


    //查询是否存在重复预案文件
    Integer queryCountWithId(@Param("contingencyPlanName") String contingencyPlanName,
                             @Param("version") String version,
                             @Param("corpCode") String corpCode,
                             @Param("id") String id);


    //判断应急预案编号是否唯一
    Integer queryByContingencyPlanCode(@Param("contingencyPlanCode") String contingencyPlanCode,
                                       @Param("corpCode") String corpCode,
                                       @Param("id") String id);

    //查找所有通过审核的应急预案
    List<ContingencyPlan> queryContingencyPlan(@Param("corpCode")String corpCode, @Param("contingencyPlanName")String contingencyPlanName);

    Integer insertAuxiliary(@Param("bean")ContingencyPlan bean);

    ContingencyPlan queryOneOnAuxiliary(@Param("id")String id);

    void updateOnAuxiliary(@Param("bean")ContingencyPlan bean);
}
